import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('userInfo')
export class userInfo extends Component {
    public user_head_url;    //用户头像URL
    public user_id;          //用户ID
    public user_name;        //用户昵称
    public user_score;       //用户昵称
    static instance: any;    //用于保存对象的实例

    public static getInstance() {
        if (userInfo.instance == null) {
            userInfo.instance = new userInfo;
            return userInfo.instance
        } else {
            return userInfo.instance
        }
    }

    start() {
        globalThis._userInfo = userInfo.getInstance();
        var data = '前端的数据';
        
    }

}

